package com.heima.user.controller.admin;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import com.heima.model.user.pojos.ApUser;
import com.heima.user.service.ApUserRealnameService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping
public class ApUserAdminRealnameController {

    @Autowired
    private ApUserRealnameService apUserRealnameService;

    /**
     * 分页查询审核列表
     */
    @PostMapping("/api/v1/auth/list")
    public ResponseResult apUserRealnameList(@RequestBody AuthDto dto) {
        log.info("到提供服务层，接到分页查询请求参数{}", dto);
        return apUserRealnameService.apUserRealnameList(dto);
    }

    /**
     * 审核成功
     */
    @PostMapping("/api/v1/auth/pass")
    public ApUser userRealnameAuthPass(@RequestBody AuthDto dto) {
        log.info("到提供服务层，审核成功请求参数{}", dto);
        return apUserRealnameService.userRealnameAuthPass(dto);
    }


    /**
     * 审核失败
     */
    @PostMapping("/api/v1/auth/fail")
    public ResponseResult userRealnameAuthFail(@RequestBody AuthDto dto) {
        log.info("到提供服务层，审核失败请求参数{}", dto);
        return apUserRealnameService.userRealnameAuthFail(dto);
    }


}
